package com.xjscrm.console.web.list;

import com.xjscrm.console.param.list.EnterpriseBlackListQuery;
import com.xjscrm.console.param.list.WwCustomerBlackDto;
import com.xjscrm.console.param.list.WwEnterpriseBlackDto;
import com.xjscrm.console.service.customer.list.EnterpriseBalckListService;
import com.xjscrm.console.vo.WwEnterpriseBlacklistVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "企业黑名单管理", tags = "企业黑名单管理")
@RestController
@RequestMapping(value = "/enterpriseBalckList")
public class EnterpriseBalckListController {

 @Autowired
    private EnterpriseBalckListService enterpriseBalckListService;

    @ApiOperation(value = "新增企业黑名单", notes = "新增企业黑名单",response = Boolean.class)
    @PostMapping(value ="/addEnterpriseBlackList" )
    public Object addEnterpriseBlackList(@RequestBody WwEnterpriseBlackDto wwEnterpriseBlackDto)throws Exception{
        enterpriseBalckListService.addEnterpriseBlackList(wwEnterpriseBlackDto);
        return true;
    }

    @ApiOperation(value = "查询企业黑名单", notes = "查询企业黑名单",response = WwEnterpriseBlacklistVo.class)
    @PostMapping(value ="/getEnterpriseBlackList" )
    public Object getEnterpriseBlackList(@RequestBody EnterpriseBlackListQuery enterpriseBlackListQuery)throws Exception{
        return enterpriseBalckListService.getEnterpriseBlackList(enterpriseBlackListQuery);
    }

    @ApiOperation(value = "删除企业黑名单", notes = "删除企业黑名单",response = Boolean.class)
    @PostMapping(value ="/deleEnterpriseBlackList" )
    public Object deleEnterpriseBlackList(@RequestBody WwEnterpriseBlackDto wwEnterpriseBlackDto)throws Exception{
        enterpriseBalckListService.deleEnterpriseBlackList(wwEnterpriseBlackDto);
        return true;
    }

}
